package com.googlecode.afdbaccess.config.propertyconfig;

import java.sql.SQLException;

import javax.sql.DataSource;

import oracle.jdbc.pool.OracleDataSource;

public class DBCPPoolFactoryForOracle extends DBCPPoolFactoryHelper {
    public DBCPPoolFactoryForOracle() {
        super(1521, "SELECT 1 FROM DUAL");
    }

    @Override
    public DataSource createDataSource() throws SQLException {
        OracleDataSource dataSource = new OracleDataSource();
        dataSource.setDriverType("thin");
        dataSource.setNetworkProtocol("tcp");
        dataSource.setServerName(serverAddress);
        dataSource.setDatabaseName(serverDatabasename);
        dataSource.setPortNumber(serverPort);
        dataSource.setUser(serverUser);
        dataSource.setPassword(serverPassword);
        return dataSource;
    }
}
